import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86136
 * Date: 2025-04-19
 * Time: 16:19
 */
public class Demo40 {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<String> queue = new LinkedBlockingQueue<>(1000);
        for (int i = 0; i < 1000; i++) {
            queue.put("aaa");
        }
        System.out.println("队列已满");
        queue.put("aaa");//阻塞等待
        System.out.println("尝试再次put");
    }
}
